package com.example.demo.person.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author zhangqiang
 * @date 2021/5/29 15:42
 */
@Data
public class PersonDTO {

    private Long id;
    /**
     * 工号 (不超过8位)
     */
    @Length(min = 8, max = 8, message = "请输入8位长度工号")
    private String jobNo;

    /**
     * 姓名 (不超过10个字)
     */
    @Length(min = 2, max = 10, message = "姓名长度在2到10之间")
    private String name;

    /**
     * 年龄 (18-60)
     */
    @Min(value = 18, message = "请输入大于等于18的值")
    @Max(value = 60, message = "请输入小于60的值")
    private Integer age;

    /**
     * 出生年月 (格式yyyy-MM-dd)
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 国籍
     */
    private String nationality;

    /**
     * 婚姻状况 (0-未婚 1-已婚)
     */
    private Integer maritalStatus;

    /**
     * 级别 (Primary-初级 Middle-中级 High-高级)
     */
    private String level;

    /**
     * 自我介绍
     */
    private String selfIntroduction;
}
